<?php

namespace App\Http\Requests;

class AdminRegisterRequest extends BaseRequest
{
    /**
     * Get the validation rules that apply to the request.
     * @return string[]
     */
    public function rules(): array
    {
        return [
            'username' => ['required','unique:admin_users','between:6,30'],
            'password' => ['required','between:6,30']
        ];
    }

    public function messages(): array
    {
        return [
            'username.required' => '用户名不能为空',
            'username.unique' => '用户名已被注册',
            'username.between' => '用户名长度不在:min-:max之间',
            'password.required' => '密码不能为空',
            'password.between' => '密码长度不在:min-:max之间',
        ];
    }
}

